package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.MallPlugin;
import com.appkubes.mall.core.po.MallPluginExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface MallPluginMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_plugin
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallPluginSqlProvider.class, method="countByExample")
    long countByExample(MallPluginExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_plugin
     *
     * @mbg.generated
     */
    @DeleteProvider(type=MallPluginSqlProvider.class, method="deleteByExample")
    int deleteByExample(MallPluginExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_plugin
     *
     * @mbg.generated
     */
    @Delete({
        "delete from mall_plugin",
        "where plugin_key = #{pluginKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String pluginKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_plugin
     *
     * @mbg.generated
     */
    @Insert({
        "insert into mall_plugin (plugin_key, app_key, ",
        "system_plugin_code, plugin_secret, ",
        "expire_time, create_time)",
        "values (#{pluginKey,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, ",
        "#{systemPluginCode,jdbcType=VARCHAR}, #{pluginSecret,jdbcType=VARCHAR}, ",
        "#{expireTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP})"
    })
    int insert(MallPlugin record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_plugin
     *
     * @mbg.generated
     */
    @InsertProvider(type=MallPluginSqlProvider.class, method="insertSelective")
    int insertSelective(MallPlugin record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_plugin
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallPluginSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="plugin_key", property="pluginKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="system_plugin_code", property="systemPluginCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="plugin_secret", property="pluginSecret", jdbcType=JdbcType.VARCHAR),
        @Result(column="expire_time", property="expireTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<MallPlugin> selectByExampleWithRowbounds(MallPluginExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_plugin
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallPluginSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="plugin_key", property="pluginKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="system_plugin_code", property="systemPluginCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="plugin_secret", property="pluginSecret", jdbcType=JdbcType.VARCHAR),
        @Result(column="expire_time", property="expireTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<MallPlugin> selectByExample(MallPluginExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_plugin
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "plugin_key, app_key, system_plugin_code, plugin_secret, expire_time, create_time",
        "from mall_plugin",
        "where plugin_key = #{pluginKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="plugin_key", property="pluginKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="system_plugin_code", property="systemPluginCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="plugin_secret", property="pluginSecret", jdbcType=JdbcType.VARCHAR),
        @Result(column="expire_time", property="expireTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
    })
    MallPlugin selectByPrimaryKey(String pluginKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_plugin
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallPluginSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MallPlugin record, @Param("example") MallPluginExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_plugin
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallPluginSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MallPlugin record, @Param("example") MallPluginExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_plugin
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallPluginSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MallPlugin record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_plugin
     *
     * @mbg.generated
     */
    @Update({
        "update mall_plugin",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "system_plugin_code = #{systemPluginCode,jdbcType=VARCHAR},",
          "plugin_secret = #{pluginSecret,jdbcType=VARCHAR},",
          "expire_time = #{expireTime,jdbcType=TIMESTAMP},",
          "create_time = #{createTime,jdbcType=TIMESTAMP}",
        "where plugin_key = #{pluginKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MallPlugin record);
}